using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using OpenWaves.ImageTransformations;

namespace OpenWaves.Web.Controls
{
    [DefaultImplementation(typeof(ResponsiveWebImageTransformationModuleImplementation))]
    [ContractClass(typeof(ResponsiveWebImageTransformationServiceContract))]
    public interface IResponsiveWebImageTransformationService
    {
        Url GetTransformedImageUrl(Url imageUrl, IEnumerable<KeyValuePair<string, IImageTransformation>> breakpoints);
    }

    [ContractClassFor(typeof(IResponsiveWebImageTransformationService))]
    abstract class ResponsiveWebImageTransformationServiceContract : IResponsiveWebImageTransformationService
    {
        public Url GetTransformedImageUrl(Url imageUrl, IEnumerable<KeyValuePair<string, IImageTransformation>> breakpoints)
        {
            Contract.Requires<ArgumentNullException>(imageUrl != null);
            Contract.Requires<ArgumentNullException>(breakpoints != null);

            throw new NotImplementedException();
        }
    }
}